<?php
	function cleanupRemoveIfOld($email) {
		global $globalStoreTime, $globalDebug;	
		
		$timeSent = strtotime($email['sent']);
		$timeNow = time();
		$timeAge = $timeNow - $timeSent;
		
		if ($globalDebug)
			print "Email ".$email['id']." is ".$timeAge."s old\n";
		
		if ($timeAge > $globalStoreTime) {
			databaseRemoveEmail($email);
		}
	}
?>